<script type="text/javascript">
	function add() {
		window.open("{:U('add')}", "_self");
	}

	function btn_search() {
		$("#form_search").submit();
	}

	function mark(action){
		var vars = $("#form_data").serialize();
		switch(action) {
			case "del":
				ui_confirm('确定要删除吗?',function(){
					sendAjax("{:U('mark?action=del')}", vars, function(data) {
						if (data.status) {
							ui_alert(data.info,function(){
								location.href=location.href;	
							});
						}
					});
				})
				break;
			default:
		}
	}
	function move_to(val) {
		var vars = $("#form_data").serialize();
		sendAjax("{:U('mark')}","action=move_folder&val=" + val + '&' + vars);
		$("input[name='id[]']:checkbox:checked").each(function() {
			$(this).parent().next().find("nobr").text(val);
			$(this).attr("checked", false);
			location.href = location.href;
		})
	}


	$(document).ready(function() {
		set_return_url();
	}); 
</script>